<template>
  <div>
    <div class="box">
      <div
        class="box1"
        v-for="(item, index) in list"
        :key="index"
        @click="goxiang(item.id)"
      >
        <img :src="item.pic" />
        <p v-html="item.title"></p>
        <p class="p1" v-html="item.descript"></p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
    };
  },
  methods: {
    goxiang(id) {
      this.$router.push({ path: "/shoudetails", query: { id } });
    },
    btn() {
      this.$router.push("/Detailtopic");
    },
  },
  mounted() {
    this.$API.shouzhuanti().then((res) => {
      this.list = res.data.data;
      // console.log(res.data.data);
    });
    // this.$axios.get("https://api.it120.cc/small4/cms/news/list").then((res) => {
    //   this.list = res.data.data;
    //   console.log(res.data.data);
    //   // console.log(res);
    // });
    //   },
  },
};
</script>
<style lang="scss" scoped>
.box {
  width: 90%;
  height: 5rem;
  margin: 1rem auto;
  font-size: 0.7rem;
  .box1 {
    width: 90%;
    height: 5rem;
    margin: 3.3rem 0;
    img {
      width: 100%;
      height: 100%;
      border-radius: 0.06rem;
    }
    .p1 {
      font-size: 0.14rem;
      color: #a8a8a8;
      width: 3.24rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}
</style>